home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue25 / compress / COMPRESS.ZIP / FAQ.TXT < prev    next >
Encoding:
Text File  |  1997-07-09  |  14.4 KB  |  299 lines

  1. <pre>
  2. TCompress 3.5 Frequently Asked Questions
  3.  
  4. Last updated: July  1997
  5.  
  6. Contents:
  7.  
  8. **** Purchasing and Licensing:
  9. * Do I need a per-copy runtime license to distribute applications
  10.   which use TCompress?
  11. * What is the price to register and use TCompress?
  12. * How quickly will a registration request be processed?
  13. * Can I also buy the source code if I want to?
  14. * Which source options do I need?
  15. * Do you take credit cards?
  16. * Do I need to make separate registrations for Delphi 1, 2, 3 and
  17.   C++ Builder?
  18. * Do you accept Compuserve SWREG registrations?
  19. * Can we pay with a check?
  20.  
  21. **** Performance and Capabilities
  22. * Does TCompress create files compatible with ZIP, LHArc or
  23.   Winzip?
  24. * Does TCompress require any external DLLs to operate?
  25. * Can I create a self-extracting EXE with TCompress?
  26. * Is TCompress "industrial strength", or does it have hidden size
  27.   limitations or problems?
  28. * What is the Compctrl unit for?
  29. * Can I create archives which span across several disks?
  30. * How good is the data compression I get with TCompress?
  31. * I have some files which don't get any smaller when compressed
  32.   using TCompress. Why not?
  33. * Why don't "protected" Paradox tables compress well with TCompress?
  34. * Is there a routine or component to auto-compress entire records
  35.   within a database?
  36.  
  37.  
  38. **** How To:
  39. * Can I seek into the middle of a compressed file and decompress
  40.   just part of it?
  41. * Does TCompress handle updates and deletions from an archive
  42.   nicely, or does it leave "holes"?
  43. * How do I use TCompress/TCDBMemo etc. if I have a Data Module in my
  44.   project?
  45. * How can I speed up access to files in an archive?
  46. * How can I compress a string in memory?
  47. * How can I read string data and compress it into a blob field?
  48.  
  49. **** Problems (also see the Troubleshooting section of Compress.hlp):
  50. * I compressed a file using TCompress, but I can't seem to decompress it. Why
  51.   not?
  52. * I compressed something into a stream, but I can't seem to expand it.
  53.   Why not?
  54. * How do I eliminate the registration popup message? Is any other
  55.   functionality affected in an unregistered copy of TCompress?
  56. * My application says "Requires BDE" when I run it on another machine. Does
  57.   TCompress require the Borland Database Engine?
  58. * What should I do if I get an "Out of Memory" message using TCompress?
  59. * Do you have any demo programs written specifically for C++ Builder, or are
  60.   they all Pascal?
  61. * My application's memory use seems to increase every time I decompress
  62.   files. Why?
  63.  
  64.  
  65.  
  66. ============ And here are the answers: =================
  67.  
  68. **** Purchasing and Licensing:
  69.  
  70. * Do I need a per-copy runtime license to distribute applications which use
  71.   TCompress?
  72. No. You only need to buy a developers' license for each developer.
  73.  
  74. * What is the price to register and use TCompress?
  75. See the pricing information and handy form in Registration section of the
  76. Compress.hlp help file which comes with TCompress.
  77.  
  78. * How quickly will a registration request be processed?
  79. Fax or Email: Usually within the same working day. Mail: you should receive
  80. the registration codes and/or source code on disk within one week or our
  81. receipt of the order.
  82.  
  83. * Can I also buy the source code if I want to?
  84. Yes. All the source of TCompress is available. You can buy the source code of
  85. the TCompress component itself (in the Compress unit), and separately buy the
  86. source of the blob field components (CDBMemo etc) in the Compctrl unit.
  87.  
  88. * Which source options do I need?
  89. If you are just planning on working with compressed files (singly or in multi-
  90. file archives), you need the Compress unit source. If you will be using any
  91. of the blob compression components or classes, you should buy both the
  92. Compress unit AND the Compctrl unit source.
  93.  
  94. * Do you take credit cards?
  95. Yes -- Mastercard and Visa only.
  96.  
  97. * Do I need to make separate registrations for Delphi 1, 2, 3 and C++
  98.   Builder?
  99. No. One registration will cover one developer's use of TCompress with all of
  100. them.
  101.  
  102. * Do you accept Compuserve SWREG registrations?
  103. No. We are not on Compuserve -- their service in this corner of the planet is
  104. not on a par with the Internet.
  105.  
  106. * Can we pay with a check?
  107. Yes. In general, we will accept most cheques in most currencies provided
  108. their value is a close match to the payment required. However, credit card
  109. orders can be processed more quickly.
  110.  
  111.  
  112. **** Performance and Capabilities
  113.  
  114. * Does TCompress create files compatible with ZIP, LHArc or Winzip?
  115. No. TCompress uses compression methods which are comparable to those used in
  116. the above programs. However, in order to meet its design goals (in
  117. particular: general purpose compression capabilities, the ability to mix
  118. compression types in one archive, and support for "custom" compression), it
  119. does not use a file format compatible with any of the above.
  120.  
  121. HOWEVER, our TCompLHA component is specifically designed to create and manage
  122. LHArc/LHA archives (which can also be used with WinZip).  Naturally, TCompLHA
  123. can also read TCompress archives. For more information, see:
  124. <A HREF="http://www.spis.co.nz/compLHA.htm">http://www.spis.co.nz/compLHA.htm</A>
  125.  
  126. * Does TCompress require any external DLLs to operate?
  127. None whatsoever. TCompress is written in 100% native Delphi. (Of course, in
  128. Delphi 3 you can choose to use TCompress as a separate DPL "package", but
  129. that's entirely up to you).
  130.  
  131. * Can I create a self-extracting EXE with TCompress?
  132. Yes. In the Compress.zip file are two example projects that show how to do
  133. this -- selfextr.dpr and selfxsml.dpr.
  134.  
  135. * Is TCompress "industrial strength", or does it have hidden size limitations
  136.   or problems?
  137. Hundreds of developers are using TCompress for an extremely wide range of
  138. applications, with file sizes ranging from kilobytes up to (but not beyond) 2GB. They, and we, believe it to be a trouble-free solution for the
  139. range of compression problems for which it was designed. Limitations tend to
  140. be wholly a factor of the deployment platform (e.g. system resources, free
  141. disk space etc).
  142.  
  143. * What is the Compctrl unit for?
  144. It contains all the classes and components for working with database Blob
  145. fields (CDBMemo, CDBImage, CDBRich, TCBlobfield, TCBlobstream etc). If you
  146. don't plan to work with any of those, you don't need to install it.
  147.  
  148. * Can I create archives which span across several disks?
  149. Yes, if you use the add-on TSegCompress component developed by Ken McClain:
  150. <A HREF="http://www.mindspring.com/~kmcclain/index.htm">http://www.mindspring.com/~kmcclain/index.htm</A>
  151.  
  152. * How good is the data compression I get with TCompress?
  153. All data compression is dependent on the method used and the nature of the
  154. input data. For best compression use the LZH algorithm -- its results should
  155. be similar to those you would get when using Zip compression with the same
  156. file(s). See the Introduction to Data Compression section of the Compress.hlp
  157. help file.
  158.  
  159. * I have some files which don't get any smaller when compressed using
  160.   TCompress. Why not?
  161. See the question above. Some files have data which is already so complex that
  162. they won't compress significantly, or at all. If you have coLZH set as your
  163. CompressionMethod, you should get roughly the same level of compression as
  164. common compression utilities will give you -- sometimes better.
  165.  
  166. * Why don't "protected" Paradox tables compress well with TCompress?
  167. When you protect a Paradox table, the entropy or "randomness" of its data
  168. increases significantly -- so much so that all compression algorithms become
  169. much less efficient. You'll encounter this whether you use TCompress or any
  170. other common compression utility.
  171.  
  172. * Is there a routine or component to auto-compress entire records within a
  173.   database?
  174. No. TCompress provides file-level compression (e.g. the entire set of
  175. database files into a single archive) and TCDBMemo etc. provide blob-level
  176. compression (e.g. autocompressing memo, image or binary fields in your
  177. database). There isn't a way to compress entire database records and still
  178. provide the kind of fast indexed random access which most databases require.
  179.  
  180. **** How To:
  181.  
  182. * Can I seek into the middle of a compressed file and decompress just part of
  183.   it?
  184. Generally speaking, no compression method will permit this. However, it can
  185. be "faked" in either of the following ways:
  186. 1. Decompress the entire file into a temporary TMemorystream, then use the
  187. TStream seek and read methods to access any part of it. This is not useful if
  188. the file is huge of course, but decompressing to a temporary TFilestream
  189. instead might be viable for some situations.
  190. 2. Instead of compressing it as a single file, compress it as a series of
  191. "chunks" or file segments, all stored in a multi-file archive (each chunk can
  192. be given a name in the archive which is its number, e.g. "1", "2" etc). With
  193. this approach you can randomly select any chunk and decompress it
  194. individually. For performance-critical applications, also see the question
  195. below on speeding up access to multi-file archives.
  196.  
  197. * Does TCompress handle updates and deletions from an archive nicely, or does
  198.   it leave "holes"?
  199. If the standard CompressFile(s)/DeleteFiles/ExpandFile(s) methods are used,
  200. archives are rewritten to eliminate holes and remove old files. You can
  201. bypass or delay this archive rewriting process if you want by using routines
  202. like CompressStreamToArchive.
  203.  
  204. * How do I use TCompress/TCDBMemo etc. if I have a Data Module in my
  205.   project?
  206. Put the TCompress object on your Data Module with your tables. Any CDBMemo
  207. etc. objects should still  be on the appropriate form(s) of course.
  208.  
  209. * How can I speed up access to files in an archive?
  210. For small archives, this is hardly necessary --- finding and decompressing
  211. any file is generally very fast. But if your archive gets very large, the
  212. sequential search needed to find a given file to decompress it can be a time-
  213. waster. A solution to this is to use ScanCompressedFile once when you
  214. first access your archive (as the Compdemo example application does). This
  215. process also creates a TCompressedFileInfo object for each file containing
  216. its position in the archive. With that information, you can open the archive
  217. as a TFileStream, seek directly to the appropriate place and use the DoExpand
  218. method to expand just that file. Time savings on large archives by using this
  219. method can be very significant indeed.
  220.  
  221. * How can I compress a string in memory?
  222. Use the CompressString and ExpandString methods (new in V3.5).
  223.  
  224. * How can I read string data and compress it into a blob field?
  225.  
  226. The simplest possible way is to use CompressString, then store that in the blob as binary data. However, this means you'll have to take care of the reading and expansion process yourself as well.
  227.  
  228. A better way might be to use the visual CDBMemo component and simply use its LoadFromFile method to load the strings. If its compression properties are correctly set, it will auto-compress the data when the record is posted.
  229.  
  230. If you want to do it non-visually (e.g. on a data module), do as follows:
  231.  
  232. a) Create a non-visual TCBlobfield component on-the-fly and point it at your existing memo field (see BLOBMAIN.PAS for an example of this).
  233.  
  234. b) Set its CompressSource and CompressionMethod properties appropriately
  235.  
  236. c) Then step through each record of the table doing this:
  237. edit;
  238. OurBlobField.LoadFromFile(yourExternalFilename);
  239. post; { write back, forcing it to compress as it is written }
  240.  
  241. Note that other handy assignment methods are available, including LoadFromStrings. If you want to compress existing uncompressed data in the memo, just assign the field to itself so that it is marked for updating, e.g. OurBlobField.asString := OurBlobField.AsString (good in Delphi 2 and 3 -- in Delphi 1 you'll have to SaveToStrings into a TStringList, then LoadFromStrings back again).
  242.  
  243. **** Problems (also see the Troubleshooting section of Compress.hlp):
  244.  
  245. * I compressed a file using TCompress, but I can't seem to decompress it. Why
  246.   not?
  247. There are two likely reasons:
  248. 1. You have your parameters round the wrong way when calling the ExpandFile
  249. method. Sensible parameter naming will help you avoid this, e.g.
  250. ExpandFile(StoredFilename, ArchiveFilename).
  251. 2. You are not specifying the correct StoredFileName. It should match the
  252. filepath which is stored in the archive -- which can be double-checked by
  253. using the Compdemo program. Review the Compress.hlp help sections on
  254. TargetPath and "Filename Handling in Compressed Archives" to see some
  255. examples of how to control what filenames and paths are stored in the
  256. archive.
  257.  
  258. * I compressed something into a stream, but I can't seem to expand it.
  259.   Why not?
  260. Don't forget to either close and reopen the stream or (more commonly)
  261. seek back to the beginning of the stream before trying to expand from it!
  262.  
  263. * How do I eliminate the registration popup message? Is any other
  264. functionality affected in an unregistered copy of TCompress?
  265. When you register TCompress, you will be given values to set into the RegName
  266. and RegNumber properties of your TCompress components. If you set these
  267. exactly as provided to you, they will eliminate the popup. Apart from the
  268. popup message, unregistered copies of TCompress behave exactly the same as
  269. registered ones.
  270.  
  271. * My application says "Requires BDE" when I run it on another machine. Does
  272.   TCompress require the Borland Database Engine?
  273. No. If you are not using the database blob compression components (CDBMemo etc),
  274. then you don't need the BDE. Just be sure that your project units
  275. don't have any unintentional references to "DB" or "DBTables" etc. in their
  276. Uses clauses. If you are a Delphi 3.0 user, make sure you have the comp35.dpk
  277. package installed, not the compdb35.dpk package, as the latter "requires"
  278. VCLDB30.
  279.  
  280. * Do you have any demo programs written specifically for C++ Builder, or are
  281.   they all Pascal?
  282. At this point, all the demonstrations are in Delphi. Visit our Web site at
  283. http://www.spis.co.nz/compress.htm from time to time to check for C++
  284. versions of the demonstrations.
  285.  
  286. * What should I do if I get an "Out of Memory" message using TCompress?
  287. This is rare and will only arise if physical or swapfile memory is limited --
  288. free up more disk space on your Windows swap drive.
  289.  
  290. * My application's memory use seems to increase every time I decompress
  291.   files. Why?
  292. If you are using the ScanCompressedFile or ScanCompressedStream methods,
  293. see the notes in their section of Compress.hlp about the TCompressedFileInfo
  294. information and the FreeFileList method, which will allow you to eliminate
  295. memory loss.
  296.  
  297. </pre>
  298. <P>Return to <A HREF="http://www.spis.co.nz/compress.htm">TCompress</A>
  299.